/*
 * Copyright (c) 2022-2022 All rights Reserved.
 */

package com.driving.core.entity;

import org.apache.ibatis.type.Alias;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.driving.core.base.AbstractModel;
import com.driving.core.util.Constant.ExerciseStatus;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 错题与收藏
 *
 * @author SAGITTAR
 * @since 2017
 */
@Getter
@Setter
@NoArgsConstructor
@Alias(value = "ExerciseCollection")
@TableName(value = "tb_exercise_collection")
public class ExerciseCollection extends AbstractModel<ExerciseCollection> {

    private static final long serialVersionUID = 991367693683932618L;

    @TableField(value = "student_id")
    private Integer studentId;

    @TableField(value = "exercise_id")
    private Integer exerciseId;

    @TableField(value = "from")
    private Integer from;

    /**
     * 逻辑删除
     */
    @TableLogic(value = "1", delval = "0")
    @TableField(value = "status")
    private Integer status = ExerciseStatus.NOT_DELETED;

    public ExerciseCollection(Integer studentId, Integer exerciseId) {
        this.studentId = studentId;
        this.exerciseId = exerciseId;
    }

    public ExerciseCollection(Integer studentId, Integer exerciseId, Integer from) {
        this(studentId, exerciseId);
        this.from = from;
    }
}
